﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using LeadTeam.Exam.Entities;
using LeadTeam.Exam.Utility;

namespace LeadTeam.Exam.AdminTool
{


    public class LookupOrganizationsController:BaseController
    {
      
        public LookupOrganizations view;
        public IList<Organizations> model;
        

        public LookupOrganizationsController(LookupOrganizations view,IMainFormView iMainFormView):base(iMainFormView)
        {
            model = GetModelData();
            this.view = view;
            this.view.Controllor = this;
        }

        private IList<Organizations> GetModelData()
        {
            SetRequestState();
            //client.Headers[HttpRequestHeader.Authorization] = "test/123";
            ReponseRes res = RequestHelper.RequestGet(ConfigHelper.GetRootServiceUrl() + "Organization");
            IList<Organizations> list = SerializeHelper.JsonDeserialize<List<Organizations>>(res.ReponseStr);

            SetDoneState();
            return list;
        }
    }
}
